Page({
  data: {
    status: ['已取消', '受理中', '上门中', '已完成'],
    statusColor: ['cancel', 'info', 'success', 'complete'],
    repairList: [],
  },
  async onShow() {
    const current = 1
    const pageSize = 20
    const { data } = await wx.http.get(`/repair?current=${current}&pageSize=${pageSize}`)

    this.setData({
      repairList: data.rows,
    })
  },
  goDetail(e) {
    wx.navigateTo({
      url: `/repair_pkg/pages/detail/index?id=${e.currentTarget.dataset.id}`,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
})
